package info.techgeek.labs.clone;

public class Customer implements Cloneable {

	String name;
	Order order;

	public Customer(String name, Order order) {
		super();
		this.name = name;
		this.order = order;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Customer() {
		super();
		// TODO Auto-generated constructor stub
	}

	public Customer(String name) {
		super();
		this.name = name;
	}

	@Override
	public Object clone() {
		try {
			Customer clonedCustomer = (Customer) super.clone();
			clonedCustomer.setOrder((Order) order.clone());
			return clonedCustomer;
		} catch (CloneNotSupportedException e) {
			e.printStackTrace();
		}
		return null;
	}

}
